﻿@{
    Layout = "~/Views/Shared/_LayoutFore.cshtml";
    ViewBag.Title = "添加收货地址";
}
@model LY.Entity.U_UserAddress
@section style{
    <style>
        .tab-content dl dt:first-child {
            width: 80px;
            text-align: right;
        }
    </style>

}
@section script{
    <script type="text/javascript">
        $(function () {
            //验证初始化 
            $("form").Validform({
                tiptype: 3
            });
            $("#return").click(function (e) {
                location.href = "/Account/UserAddress";
            });
        });
        function OnSuccess(data) {
            if (data.Status == 1) {
                $.dialog.tips(data.Message, 1, 'tips.gif', function () {
                    window.location.href = data.Data;
                });
            } else if (data.Status == 2) {
                window.location.href = data.Data;
            }
            else {
                $.dialog.tips(data.Message);
                return false;
            }
            return false;
        }
    </script>
}
<div class="RightContrent">
    <div style="margin-left: 50px; margin-right: 50px;">
        <div class="tab-content">
            <div class="line10"></div>
            <div class="line10"></div>
            <div class="tab_title">@ViewBag.Title</div>
            <div class="tab-content">
                <div style="width: 16px; height: 12px; float: left;">
                    <img src="~/Content/Images/leftarraw.png" />
                </div>
            </div>

            <div class="tab-content_border">

                <div class="u-center">
                    <div class="u-form-wrap">
                        @using (Ajax.BeginForm("SaveAddressEdit", new AjaxOptions() { OnSuccess = "OnSuccess" }))
                        {
                            <div class="tab-content">

                                <dl>
                                    <dt>收货人姓名：</dt>
                                    <dd>
                                        <input type="text" class="input normal" id="Name" name="Name" datatype = "*" value="@Model.Name" />
                                    </dd>
                                </dl>
                                <dl>
                                    <dt>手机号码：</dt>
                                    <dd>
                                        <input type="text" class="input normal" id="Tel" name="Tel"  datatype = "m"  errormsg = "手机号码格式不正确" value="@Model.Tel"  /></dd>
                                </dl>
                                <dl>
                                    <dt>收货地址：</dt>
                                    <dd>
                                        <input type="text" class="input normal1" id="Address" name="Address" datatype = "*"  value="@Model.Address"/></dd>
                                </dl>
                                <dl>
                                    <dt>是否默认：</dt>
                                    <dd>
                                    @Html.ResourceRadioList("IsDefault", "SubProject", Model.IsDefault == null ? 0 : Model.IsDefault, true)
                                </dl>
                                <dl>
                                    <dt></dt>
                                    <dd>
                                        <input type="hidden" value="@Model.MemberId" id="MemberId" name="MemberId"/>
                                        <input type="hidden" value="@Model.Id" id="Id" name="Id"/>
                                    </dd>
                                </dl>
                                <dl>
                                    <dt>
                                        <dd style="margin-left: 80px">
                                            <input type="submit" class="btn" value="确定" id="btnAdd" />
                                            <input type="button" class="btn" value="返回" id="return" />
                                        </dd>
                                    </dt>
                                </dl>
                            </div>
                        }

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
